using System.Collections.Generic;
using System.Threading.Tasks;
using PropertyChanged;
using System.Windows;
using System.Windows.Input;
using WPFPractice.Utils;
using WPFTemplateLib.WpfHelpers;
using System;

namespace WPFPractice.Windows
{
    /// <summary>
    /// 用户控件演示
    /// </summary>
    public partial class WinUserControls : Window
    {
        private WinUserControlsViewModel _VM;

        public WinUserControls()
        {
            InitializeComponent();
            _VM = new WinUserControlsViewModel();
            DataContext = _VM;
        }
    }

    [AddINotifyPropertyChangedInterface]
    public class WinUserControlsViewModel : MyViewModelBase
    {
        #region 成员



        #endregion

        public WinUserControlsViewModel()
        {
            SetCommandMethod();
        }

        #region 辅助方法

        public void ShowInfo(string info)
        {
            StatusInfo = $"{info}";
        }

        #endregion

        #region 绑定

        /// <summary>
        /// 状态信息
        /// </summary>
        public string StatusInfo { get; set; }

        #endregion

        #region 命令

        public ICommand AddCmd { get; set; }

        #endregion

        /// <summary>
        /// 命令方法赋值（在构造方法中调用）
        /// </summary>
        private void SetCommandMethod()
        {
            AddCmd ??= new RelayCommand(o => true, async o =>
            {
                
            });
        }
    }
}
